package jjn.round2;

/**
 * @author Jiang Jining
 * @since 2023-05-03 13:19
 */
public class Offer10_2_NumWays {
    public int numWays(int n) {
        int[] ways = new int[n + 2];
        ways[0] = 1;
        ways[1] = 1;
        for (int i = 2; i <= n; i++) {
            ways[i] = ways[i - 1] + ways[i - 2];
            ways[i] = ways[i] % 1000000007;
        }
        return ways[n];
    }
}
